1 Public Class frmSTOCKMONITORINGBALANCES
2
3     Private Sub frmSTOCKMONITORINGBALANCES_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
4         MDIDISABLED()
5     End Sub
6
7     Private Sub FrmSTOCMONITORINGBALANCES_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
8         Dim i As Integer
9         MDIREFRESH()
10         With MDIMain
11             .cmdNew.Enabled = False
12             .cmdEdit.Enabled = False
13             .cmdDelete.Enabled = False
14             
'.ToolStripNew.Enabled = False
15             
'.ToolStripEdit.Enabled = False
16             
'.ToolStripDelete.Enabled = False
17         End With
18         
'sqlSTR = "SELECT tbl_category_item_file.item_id AS 'ID', tbl_category_item_file.Item_name as 'Name', tbl_category_item_file.Item_Description as 'Description', tbl_stocks_balances.item_qty as 'Quantity' FROM tbl_category_item_file JOIN tbl_stocks_balances ON tbl_stocks_balances.item_id = tbl_category_item_file.item_id "
19
20         
'sqlSTR = "select tbl_category_item_file.item_id AS 'ID', tbl_category_item_file.Item_name as 'Name', tbl_category_item_file.Item_Description as 'Description', tbl_category_item_file.item_price as 'Price', tbl_stocks_balances.item_qty as 'Quantity' , (tbl_stocks_balances.item_qty * tbl_category_item_file.item_price) as 'Total' FROM tbl_category_item_file, tbl_stocks_balances where tbl_category_item_file.Item_id = tbl_stocks_balances.item_id "
21         sqlSTR =
"SELECT TBL_category_item_file.item_id AS 'ID', Replace(Replace(TBL_Category_Item_File.Item_name,'$.$',''''),'$..$',',') as 'Name', TBL_Category_Item_File.Item_Description as 'Description / Item Number', TBL_Category_Item_File.Item_Barcode AS 'Barcode', TBL_Category_Item_File.Item_Reorder_Point AS 'Reorder Point', TBL_Category_Item_File.Item_Org_Price as 'Price W/O VAT',TBL_Category_Item_File.item_price as 'Price W/ VAT', TBL_Stocks_Balances.Item_QTY as 'Quantity' , (tbl_stocks_balances.item_qty * tbl_category_item_file.item_price) as 'Total'" & _
22                  
"FROM TBL_category_item_file INNER JOIN TBL_Stocks_Balances ON TBL_Category_Item_File.Item_ID = TBL_Stocks_Balances.Item_ID ORDER BY TBL_Category_Item_File.Item_name"
23         FillListView(ExecuteSQLQuery(sqlSTR), listStocks,
0)
24         For i =
0 To listStocks.Items.Count - 1
25             If Int(listStocks.Items(i).SubItems(
7).Text) <= 0 Then
26                 listStocks.Items(i).ForeColor = Color.Brown
27             End If
28         Next
29         Audit_Trail(xUser_ID, TimeOfDay,
"View Stocks Monitoring Balances")
30         listStocks.Focus()
31     End Sub
32
33     Private Sub cmdcancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdcancel.Click
34         grpCat.Visible = False
35     End Sub
36
37     Private Sub CmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSearch.Click
38         sqlSTR =
"SELECT TBL_category_item_file.item_id AS 'ID', Replace(Replace(TBL_Category_Item_File.Item_name,'$.$',''''),'$..$',',') as 'Name', TBL_Category_Item_File.Item_Description as 'Description', TBL_Category_Item_File.Item_Org_Price as 'Price W/O VAT',TBL_Category_Item_File.item_price as 'Price W/ VAT', TBL_Stocks_Balances.Item_QTY as 'Quantity' , (tbl_stocks_balances.item_qty * tbl_category_item_file.item_price) as 'Total'" & _
39                  
"FROM TBL_category_item_file " & _
40                  
"INNER JOIN TBL_Stocks_Balances ON TBL_Category_Item_File.Item_ID = TBL_Stocks_Balances.Item_ID " & _
41                  
"WHERE Replace(Replace(Item_Name,'$.$',''''),'$..$',',') LIKE '%" & R_eplace(txtname.Text) & "%' ORDER BY Item_name"
42         FillListView(ExecuteSQLQuery(sqlSTR), listStocks,
0)
43         grpCat.Visible = False
44     End Sub
45
46     Private Sub frmSTOCKMONITORINGBALANCES_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
47         With Me
48             GroupBox1.Width = (.Width - (MDIMain.TSHoldRight.Width /
2)) + 60
49             GroupBox1.Height = .Height - (MDIMain.TSHoldAdvisory.Height +
45)
50             .listStocks.Width = GroupBox1.Width -
10
51             .listStocks.Height = GroupBox1.Height -
18
52         End With
53     End Sub
54 End Class


Gõ tìm kiếm nhanh...